

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="main" />
        <title>Create Budget</title>         
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${resource(dir:'')}">Home</a></span>
            <span class="menuButton"><g:link class="list" action="list">Budget List</g:link></span>
            <!-- This is the help button. -->
            <%  def help = Help.findByNameAndLanguage("budget_create", session.language)
            def helplink = createLink(action:'show', controller:'help', id: help.id )%>
            <a href="#" onClick="MyWindow=window.open('${helplink}','Help','width=350,height=450'); return false;">Help</a>
            <!-- This is the end of the help button. -->
        </div>
        <div class="body">
            <h1>Create Budget</h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${budgetInstance}">
            <div class="errors">
                <g:renderErrors bean="${budgetInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form action="save" method="post" >
                <div class="dialog">
                    <table>
                        <tbody>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="expectedTotalIncome">Expected Total Income:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:budgetInstance,field:'expectedTotalIncome','errors')}">
                                    <input type="text" id="expectedTotalIncome" name="expectedTotalIncome" value="${fieldValue(bean:budgetInstance,field:'expectedTotalIncome')}" />
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="expectedVariableCost">Expected Variable Cost:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:budgetInstance,field:'expectedVariableCost','errors')}">
                                    <input type="text" id="expectedVariableCost" name="expectedVariableCost" value="${fieldValue(bean:budgetInstance,field:'expectedVariableCost')}" />
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="knownTotalIncome">Known Total Income:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:budgetInstance,field:'knownTotalIncome','errors')}">
                                    <input type="text" id="knownTotalIncome" name="knownTotalIncome" value="${fieldValue(bean:budgetInstance,field:'knownTotalIncome')}" />
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="knownVariableCost">Known Variable Cost:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:budgetInstance,field:'knownVariableCost','errors')}">
                                    <input type="text" id="knownVariableCost" name="knownVariableCost" value="${fieldValue(bean:budgetInstance,field:'knownVariableCost')}" />
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="year">Year:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:budgetInstance,field:'year','errors')}">
                                    <input type="text" id="year" name="year" value="${fieldValue(bean:budgetInstance,field:'year')}" />
                                </td>
                            </tr> 
                        
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><input class="save" type="submit" value="Create" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
